# Maintainer: Andy Postnikov <apostnikov@gmail.com>
pkgname=php83-pecl-phpy
_extname=phpy
pkgver=1.0.8
pkgrel=0
pkgdesc="Extension allows PHP 8.3 to directly use Python modules and functions without RPC - PECL"
url="https://pecl.php.net/package/phpy"
arch="all"
license="apache-2.0"
_phpv=83
_php=php$_phpv
depends="$_php-common"
makedepends="$_php-dev python3-dev"
source="php-pecl-$_extname-$pkgver.tgz::https://pecl.php.net/get/$_extname-$pkgver.tgz"
builddir="$srcdir/$_extname-$pkgver"

build() {
	phpize$_phpv
	./configure --prefix=/usr --with-php-config=php-config$_phpv
	make
}

check() {
	$_php -d extension="$builddir"/modules/$_extname.so --ri $_extname
}

package() {
	make INSTALL_ROOT="$pkgdir" install
	local _confdir="$pkgdir"/etc/$_php/conf.d
	mkdir -p $_confdir
	echo "extension=$_extname" > $_confdir/$_extname.ini
}

sha512sums="
75ad52c496916e7166f17f2ae532a3b95596a3a02f3c4add4cb92f14322c07122d83e6d90af35e5cba2214ff0567248d20501b6a05d8e784c98ffb5cfa2210e0  php-pecl-phpy-1.0.8.tgz
"
